<?php
/**
 *
 *
 *
 *
 *
 */
interface Yz_Action_Interface
    extends Countable
{
    /**
     *  Constructor args: list of sources (required for any action)
     */
#    public function __construct($sources);

    /**
     *  the main method: the point of Action
     */
    public function __invoke();
    public function execute();

    /**
     *  For Actions w/o values (SELECT, DELETE) - not implemented
     *  For Actions w/ values (INSERT, UPDATE) -- values are optional
     *  UPDATE with no values can also be used, if the real values are taken from DB
     *      (e.g. UPDATE ... SET x=x+1, y=(SELECT y FROM ...) )
     */
#    public function assignValues($values=null);


    /**
     *  Fields:
     *      hash [fieldName: fieldClause]
     *  - for UPDATE: required
     *      NOTE: if updating multiple tables, it is also required for fieldName to be fully qualified
     *  - for SELECT: required, unless '*' is acceptable and desired
     *  - for INSERT: optional; in case no fields supplied the values must also be omitted
     *  - for DELETE: possible
     *  @param array|string
     */
#    public function assignFields($fields);

    /**
     *  For ALL Actions, count returns the number of rows matched (selected, updated...)
     */
    public function count();

    /**
     *  For SELECT
     *  Different Fetch actions may return one or a set of rows, or a scalar
     */
#    public function fetch();

    /**
     *  For INSERT
     */
#    public function getInsertId();


}
